entry: Do not unset selection if failing to update the primary selection
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 2 Jul 2014 13:35:07 +0000 (15:35 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 2 Jul 2014 16:57:39 +0000 (18:57 +0200)
This is expected to happen on wayland and other platforms with no primary selection,
and just leads to the selected text being cleared after any attempt to change the
text selection itself through either mouse/keyboard.

gtk/gtkentry.c

index d77c50fddcacfe55376c1b9ce8b63533108d0e2b..abaa20b827fccefef9f37be9061f06b2f6069b54 100644 (file)
@@ -7332,9 +7332,8 @@ gtk_entry_update_primary_selection (GtkEntry *entry)
   
   if (gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start, &end))
     {
-      if (!gtk_clipboard_set_with_owner (clipboard, targets, n_targets,
-                                        primary_get_cb, primary_clear_cb, G_OBJECT (entry)))
-       primary_clear_cb (clipboard, entry);
+      gtk_clipboard_set_with_owner (clipboard, targets, n_targets,
+                                    primary_get_cb, primary_clear_cb, G_OBJECT (entry));
     }
   else
     {